<form action="" method="post" enctype="multipart/form-data" >
Login
<br />
<input type="text" name="login" class="input_style"/>
<br />
Hasło
<br />
<input type="text" name="pass" class="input_style"/>
<br />
Powtórz hasło
<br />
<input type="text" name="pass2" class="input_style"/>
<br />
<input name="submit" type="submit" value="Zatwierdź" />
</form>

<?php
$sini=parse_ini_file("setup.ini",1);

if($_POST!=NULL && $_POST['pass'] == $_POST['pass2']){
        $login = $_POST['login'];
        $haslo = $_POST['pass'];

        $host = $sini['config']['db_params_host'];
        $port = $sini['config']['db_params_port'];
        $user = $sini['config']['db_params_username'];
        $pass = $sini['config']['db_params_password'];
        $mydb = $sini['config']['db_params_dbname'];



        $link = mysql_connect($host.":".$port, $user, $pass);
        if (!$link) {
                die('Połączenie nieudane...</br> ' . mysql_error().'<br />');
        }
        $db_selected = mysql_select_db($mydb, $link);
        if (!$db_selected) {
                die ('Nie można ustawić bazy : '.$mydb . mysql_error());
        }
        $sql = "INSERT INTO uzytkownik(id,login,haslo_hash, email) VALUES (1,'".$login."' , '".md5($haslo)."', '".$sini['config']['mail_user']."');";
        $res = mysql_query($sql);
        if (!$res) {
                die( mysql_error());
        }



	$tab=Array ( 'config' => Array (
                'acc_ok' => 1
                   ));
         $n->w2i($tab, "setup.ini",TRUE);
}

        $sini=parse_ini_file("setup.ini",1);
        if($sini['config']['acc_ok'] == 1){
            echo '<form action="index.php?token='.md5($results[5]['file']).'" method="post" enctype="multipart/form-data" >';
            echo " <input type='submit' ".$str." value='dalej' /></form>";
        }
 ?>
